home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / NEWSOFT / OCTOBER / PCLTOOLS / ASC2PCL / rep_C < prev    next >
Text File  |  1996-06-27  |  2KB  |  95 lines

  1. # Search and Replace patterns for ASC2PCL
  2. # Enables context-sensitive printing of C/C++ source code
  3.  
  4. # Commentary lines start with a '#'. They may be placed anywhere
  5. # except within the 4-line search/replace structure.
  6.  
  7. # Modes - Must start with '{' as first character.
  8. # Format: identifier, internal font number, style, weight, scaling
  9. # factor in promilles, indent in chars, scalex, scaley in promilles
  10.  
  11. {norm, 0,0,0,1000,0,1000,1000}   mode 1 (standard text, Courier)
  12. {comm, 0,1,3,1000,0,1000,1000}   mode 2 (commentary     Courier bd it)
  13. {quote,0,1,0,1000,0,1000,1000}   mode 3 (quote          Courier it)
  14. {func, 0,0,3,1000,0,1000,1000}   mode 4 (function       Courier bd)
  15. {prep, 4,0,3,1500,0,1000,1000}   mode 5 (preprocessor   Univers bd)
  16.  
  17.  
  18. # Search/Replace patterns - start with the first line that doesn't
  19. # begin with a '{' (and isn't a commentary line). The first line is:
  20. # offset when found, mode exception list in {...}, list of prefixes
  21. # enclosed in {...}. If the first character in the prefixes list
  22. # has to be '}' you have to represent it by \&7d.
  23.  
  24. # C functions
  25. -1,{!norm},{ ,\&09,*,/,(,),{,},:,;,.,,,>,<,+,-,!,=,~,?}
  26. \0\{\[a-zA-Z0-9_\]\[a-zA-Z0-9_\]\*\}\{\[ \&09\]\*\}(
  27. \1exit\1for\1if\1return\1switch\1while
  28. \0\m{func}\1\M{func}\2
  29.  
  30. # C functions at the start of a line
  31. -1,{!norm},{\&00}
  32. \&00\{\[a-zA-Z0-9_\]\[a-zA-Z0-9_\]\*\}\{\[ \&09\]\*\}(
  33. \1exit\1for\1if\1return\1switch\1while
  34. \m{func}\1\M{func}\2
  35.  
  36. # C commentaries on
  37. 0,{!norm},{/}
  38. /\&2a
  39.  
  40. \M{norm}\m{comm}/\&2a
  41.  
  42. # C++ commentaries
  43. 0,{!norm},{/}
  44. \{//*\}\n
  45.  
  46. \m{comm}\1\M{comm}
  47.  
  48. # C commentaries off
  49. 0,{!comm},{*}
  50. \&2a/
  51.  
  52. \&2a/\M{comm}\m{norm}
  53.  
  54. # For consistency between #include "..." and #include <...>
  55. 0,{!norm},{#}
  56. \{#\[ \&09\]\*include\}\{*\}<\{*\}>
  57.  
  58. \m{prep}\1\M{prep}\2\m{quote}<\3>\M{quote}
  59.  
  60. # C preprocessor
  61. -1,{!norm},{#}
  62. \{#\[ \&09\]\*\[a-z\]\[a-z\]\*\}\[ \n\&09\]
  63.  
  64. \m{prep}\1\M{prep}
  65.  
  66. # C double quoute on
  67. 0,{!norm},{"}
  68. "
  69.  
  70. \M{norm}\m{quote}"
  71.  
  72. # C double quote off
  73. 0,{!quote},{"}
  74. "
  75.  
  76. "\M{quote}\m{norm}
  77.  
  78. # C single quote
  79. 0,{!norm},{'}
  80. '\{\[!'\]\*\}'
  81.  
  82. \m{quote}'\1'\M{quote}
  83.  
  84. # Escape sequences - to avoid other replacing rules being used within it.
  85. 0,{},{\&1b}
  86. \{\&1b*\[A-Z\]\}
  87.  
  88. \1
  89.  
  90. # Tab code - preserve it!
  91. 0,{},{\&09}
  92. \&09
  93.  
  94. \&09
  95.